import { IArticleItem } from "@/utils/type";
import { IRouteComponentProps, Link } from "umi";
import cls from 'classnames';
import React from "react";
import styles from './index.less';

interface IProps {
  articles: IArticleItem[],
  info?: {},
  cb?: ()=>void
}

const ArticleList: React.FC<IProps> = (props) => {
  console.log('article list...');
  return <React.Fragment>{
    props.articles.map(article => {
      return <Link key={article.id} to={`/article/${article.id}`}>
        <li>
          <img src={article.cover} alt="" />
          <p className={cls(styles.title, styles.active)}>{article.title}</p>
          <p className="title1">{article.content}</p>
          <p>{article.summary}</p>
        </li>
      </Link>
    })
  }</React.Fragment>
}

export default ArticleList;